package org.stragma.apply.signatures

import scala.collection.mutable._

import aterm._
import org.stragma.apply.signatures.Apply._
import org.stragma.apply.signatures.Conversions._

/*
 * These conversions are needed to compensate for the presense of multiple
 * convert methods across the different signature files
 */
object ApplyExtensions {

	/**
	 * 	This Var extension has been created to introduce a semi concrete syntax kind of approach
	 */
	class VarExtension (arg0_ : TId) extends Var (arg0_) {
		
		/**
		 *	First we specify support for the logical operators
		 */
		def <= (arg1 : TExp) = Leq (this, arg1)
		def >= (arg1 : TExp) = Geq (this, arg1)
		def <  (arg1 : TExp) = Lt (this, arg1)
		def >  (arg1 : TExp) = Gt (this, arg1)
		def == (arg1 : TExp) = Equ (this, arg1)
		
		/**
		 * Now some of the mathematical operators
		 */
		def - (arg1 : TExp) = Sub (this, arg1)
		def * (arg1 : TExp) = Mul (this, arg1)
		def + (arg1 : TExp) = Add (this, arg1)
		def / (arg1 : TExp) = Div (this, arg1)
		
		/**
		 * Some other operators
		 */
		def := (arg1 : TExp) = Assign (this, arg1)
		def @:= (arg1 : TExp) = CAssign (this, arg1)
		
	}
	
}